package com.jsnkj.basic.bean

import java.io.Serializable


class SettingEntity : Serializable {

    /**
     * exchange_rate : 10000
     * withdrawals : [{"id":"1001","value":"0.3","label":"新人专项","limit":"1"},{"id":"1002","value":"1.0","label":"每日一次","limit":"1"},{"id":"1003","value":"2.0","label":"","limit":"0"},{"id":"1004","value":"5.0","label":"","limit":"0"},{"id":"1005","value":"10.0","label":"","limit":"0"},{"id":"1006","value":"20.0","label":"","limit":"0"},{"id":"1007","value":"50.0","label":"","limit":"0"},{"id":"1008","value":"100.0","label":"","limit":"0"}]
     */
    //汇率
    var exchange_rate = 0

    //提现数据
    var withdrawals: List<WithdrawalsEntity>? = null

    var max_redpack_amount = 0

    var withdraw_limit = 0.0
    var earnings: EarningsBean? = null
    var invites: InvitesBean? = null

    var agreement: String? = null
    var privicy: String? = null

    //版本更新
    var app_code = 350
    var app_version: String? = null


    var player_group_url: String? = null
    var service_url: String? = null
    override fun toString(): String {
        return "SettingEntity(exchange_rate=$exchange_rate, withdrawals=$withdrawals, max_redpack_amount=$max_redpack_amount, withdraw_limit=$withdraw_limit, earnings=$earnings, invites=$invites, agreement=$agreement, privicy=$privicy, app_code=$app_code, app_version=$app_version, player_group_url=$player_group_url, service_url=$service_url)"
    }
}


class EarningsBean : Serializable {
    /**
     * max_per_guest : 200
     * b_to_a_ratios : [{"b_value":1,"a_value":1,"condition":"=","ratio":0},{"b_value":2,"a_value":1.5,"condition":"=","ratio":0},{"b_value":5,"a_value":2.5,"condition":"=","ratio":0},{"b_value":10,"a_value":3,"condition":"=","ratio":0},{"b_value":50,"a_value":12,"condition":"=","ratio":0},{"b_value":100,"a_value":0,"condition":">","ratio":0.05}]
     */
    var max_per_guest = 0
    var b_to_a_ratios: List<BToARatiosBean>? = null

    class BToARatiosBean {
        /**
         * b_value : 1
         * a_value : 1
         * condition : =
         * ratio : 0
         */
        var b_value = 0
        var a_value: Float = 0F
        var condition: String? = null
        var ratio: Float = 0F
    }
}


class InvitesBean : Serializable {
    /**
     * app_name : 剧上头
     * ulinkid : usr1k5cl0t81j3om
     * download_app_url : http://wz.baiyiadsense.com/invite/com_test0506_app.apk
     */
    var ulinkid: String? = null
    var download_app_url: String? = null
    var local_download_url: String? = null


    fun getDownUrl(): String? {
        if (download_app_url.isNullOrEmpty()) {
            return local_download_url
        }
        return download_app_url
    }

}

